<?php
namespace app\face\controller;
use app\admin\controller\Common;
use app\service\roominfoService;
use app\service\apixcxService;
use think\Db;
class User extends Common{
	public function userlist(){
		$com = $this->pidTokenId();
		$whe['community_id'] = array('in',$com['community_id']);
		$communitylist = Db::name('community')->where($whe)->field('community_id,community_name')->select();;
        $community_id = $com['community_id'];
        $this->assign('communitylist',$communitylist);

        $page = request()->has('page') ? request()->get('page') : 1;
        $userlist=Db::name('face_user_room')
                ->where($whe)
                ->order('id desc')->paginate(100, false, [
                    'page'  =>  $page,
                    'query' =>  $whe
                ]);
        $this->assign("userlist",$userlist);
        return $this->fetch();
	}

	public function test(){
		$data["biz_id"]="5456897876547676532";
		$data["zim_id"]="33dd9befa415cac492ced79d9610c351c29";//0ea954b11d29610ef79ae3712be036c9c29
		$api=new apixcxService();
		$res=$api->faceimgquery(json_encode($data));
		
		var_dump($res);
	}

	public function test2(){
		echo 2;
		$deviceKeys="84E0F420854401F8,84E0F42085C601F8,84E0F42088D301F8,84E0F4213A2901FA,84E0F42157B306B2,84E0F420386B02F8,";
		$test=rtrim($deviceKeys,",");
		echo $test;
	}
	
}